<?php

namespace App\Http\Controllers\Home;

use App\Model\OrderBonus;
use Illuminate\Http\Request;

class BonusController extends BaseController
{
    public function index()
    {
        $items = OrderBonus::where('bonus_user_id','=',$this->loginUserId())
            ->orderBy('created_at','desc')
            ->select('id','out_trade_no','order_user_name','order_user_mobile','level','amount','status')
            ->get();

        return $this->success($items);
    }
    public function show($id)
    {
        $item = OrderBonus::where('bonus_user_id','=',$this->loginUserId())
            ->orderBy('created_at','desc')
            ->select('id','out_trade_no','order_user_name','order_user_mobile','level','amount','status')
            ->find($id);

        return $this->success($item);
    }
}
